
import { Navigator, View, Button, Text, Block, OpenData } from '@tarojs/components'


import { useSelector, useDispatch } from 'react-redux'

import '../GovTemp/index.less'

function UserCenterHeader({ userInfo: { __userInfo, __authorizePhoneStatus }, myUnitList }) {
  return (
    <Block>
      <View className='d_between_center user-header bg_ffffff'> 
        <View  className='d_flex'>
        <Block>
          <View className='avatar_image'>
          <OpenData className='img' type='userAvatarUrl' />
          </View>
        </Block>

        <Block>
          <View className='d_column ml_24'>
            <View className='ff_M fontsize_36'>
              <OpenData  type='userNickName' />
            </View>
            <View className='fontsize_24 ff_R color_999'>
              {(__authorizePhoneStatus.authorizeStatus === 0
                ? '未'
                : '已') +
                '认证' +
                (__userInfo.gov ? '干部' : '居民')}
            </View>
          </View>
        </Block>
        </View>
        <Block>
          {__userInfo.isAuthUserInfo &&
            __authorizePhoneStatus.authorizeStatus === 1 ? (
            <Navigator
              hoverClass='none'
              url='/subs/instruction/pages/my-company/my-company'
              className='color_1883C9 ff_M fontsize_24 avatar_change'
            >
              {(myUnitList.length === 0 ? '完善' : '切换') + '身份'}
            </Navigator>
          ) : (
            <View
              slot='right-icon'
              className='color_1883C9 ff_M fontsize_24 avatar_change'
            >
              {(myUnitList.length === 0 ? '完善' : '切换') + '身份'}
              {/* <AuthButton
                  withUserInfo={!__userInfo.isAuthUserInfo}
                  withPhone={__authorizePhoneStatus.authorizeStatus !== 1}
                  withSubscribe={false}
                  onSuccess={this.privateStopNoop.bind(
                    this,
                    this.authPhoneSuccess
                  )}
                ></AuthButton> */}
            </View>
          )}
        </Block>
      </View>

    </Block>

  )
}

export { UserCenterHeader }